package com.netease.easyexcel.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

@Data
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@ToString
public class GraphEntityDto {

    private String name;
    private String type;
    private String description;
    private String serviceId;
    private List<GraphEntityPropertyDto> propertyList;
    private String resolvers;
    private String ideVersion;
    private String tableName;

    @Data
    @NoArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ToString
    public static class GraphEntityPropertyDto {
        private String name;
        private String label;
        private String description;
        private String type;
        private String format;
        private boolean isLeaf;
        private boolean editable;
        private boolean deleteable;
        private String ideVersion;
        private GraphEntityPropertyDisplayDto display;
        private int _posIndex;
        private String columnName;
        private Boolean primaryKey;
        private Object defaultValue;
        private Boolean required;
        private List<String> rules;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ToString
    public static class GraphEntityPropertyDisplayDto {
        private boolean inTable;
        private boolean inFilter;
        private boolean inForm;
        private boolean inDetail;
    }
}
